use ztask::TaskExecutor;
use ztask::task::*;

fn main() {
    let mut executor = TaskExecutor::new();

    let task0 = Log::new("Task 0 finished");
    let task1 = Lock::new(AfterTimes::new(1), Log::new("Task 1 finished"));
    let task2 = Lock::new(AfterTimes::new(2), Log::new("Task 2 finished"));
    let task3 = Lock::new(AfterTimes::new(3), Log::new("Task 3 finished"));
    let task4 = Lock::new(AfterTimes::new(4), Log::new("Task 4 finished"));

    executor.start_task(task0);
    executor.start_task(task1);
    executor.start_task(task2);
    executor.start_task(task3);
    executor.start_task(task4);

    println!("Now have {} tasks.", executor.task_count());

    for i in 0..10 {
        println!("Current Frame {}", i);
        executor.step();
    }
}